<!DOCTYPE html>
<html>
  <head>
    <title>JSTest8.html</title>
	
    <meta name="keywords" content="keyword1,keyword2,keyword3">
    <meta name="description" content="this is my page">
    <meta name="content-type" content="text/html; charset=UTF-8">
    
	<script type="text/javascript">
		window.onload = function(){
			var liNodes = document.getElementsByTagName("li");
			for(var i=0; i<liNodes.length; i++){
				liNodes[i].onclick = function(){
					var val = this.firstChild.nodeValue;
					
					var pattern = /^\^{2}/g;
					if(pattern.test(val)){
						val = val.replace(pattern, "");
					}else{
						val = "^^" + val;
					}
					
					this.firstChild.nodeValue = val;
				}
			}
		}
	</script>

  </head>
  
  <body>
	<p>Which city do you like to live?</p>
  	<ul id="city">
  		<li id="beijing">BeiJing</li>
  		<li id="shanghai">ShangHai</li>
  		<li id="guangzhou">GuangZhou</li>
  	</ul>
  </body>
</html>

